<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <?php                        	
            //the wsdl where the service is locatd
    		$wsdl="https://ppsacredential.service.passport.net/PPSACredentialWSDL.srf";
			
            //define new soap client which will conect to the service
            //'local_cert' => 'C:\OpenSSL\bin\adam.pem' // the path of the .PEM certificate
            //'passphrase' => '1234' // the certificate password
            //note you will need to create a .PEM certifiate using openssl
		    $client = new SoapClient($wsdl, 
		  		array(		  		
            		'exceptions'        => 1,		  		
		  			'trace' 			=> 1, 
		  			'verify_peer' 		=> 1, 
		  			'verifyhost' 		=> 1, 
		  			'allow_self_signed' => 1, 
		  			'local_cert' 		=> 'C:\cert\adambradleyconsulting\all.cer.pem',
		  			'passphrase' 		=> '',
		  			'cafile'			=> 'C:\cert\adambradleyconsulting\all.pem',
					'capath'			=> 'C:\cert\adambradleyconsulting',
		  			//'CN_match'			=> 'queensland',
		  			'capture_peer_cert' => 1,
		  			'capture_peer_chain'=> 1		  		
		  		));
		  				  		
            //the name space of the needed functions u can get it's informaton from the wsdl file    		
			$client->namespaces='http://schemas.microsoft.com/Passport/SoapServices/CredentialServiceAPI/V1';			
			//$strHeaderComponent_Session = "<WSSecurityHeader xmlns=\"http://schemas.microsoft.com/Passport/SoapServices/CredentialServiceAPI/V1\">&lt;s:ppSoapHeader xmlns:s=\"http://schemas.microsoft.com/Passport/SoapServices/SoapHeader\" version=\"1.0\"&lt;s:lcid&gt;1033&lt;/s:lcid&gt;&lt;s:sitetoken&gt;&lt;t:siteheader xmlns:t=\"http://schemas.microsoft.com/Passport/SiteToken\" id=\"256296\"/&gt;&lt;/s:sitetoken&lt;/s:ppSoapHeader&gt;</ppSoapHeader25></WSSecurityHeader>";			
			$strHeaderComponent_Session = "<ns1:ppSoapHeader25>&lt;s:ppSoapHeader xmlns:s=\"http://schemas.microsoft.com/Passport/SoapServices/SoapHeader\" version=\"1.0\"&gt;&lt;s:lcid&gt;1033&lt;/s:lcid&gt;&lt;s:sitetoken&gt;&lt;t:siteheader xmlns:t=\"http://schemas.microsoft.com/Passport/SiteToken\" id=\"256296\"/&gt;&lt;/s:sitetoken&gt;&lt;/s:ppSoapHeader&gt;</ns1:ppSoapHeader25>";
			$objVar_Session_Inside = new SoapVar($strHeaderComponent_Session, XSD_ANYXML, null, null, null);
			$objHeader_Session_Outside = new SoapHeader('http://schemas.microsoft.com/Passport/SoapServices/CredentialServiceAPI/V1', 'WSSecurityHeader', $objVar_Session_Inside);			
			$client->__setSoapHeaders(array($objHeader_Session_Outside));
						
			try
           	{                                                	               
				$PassIDIn = array('pit' => "PASSID_SIGNINNAME", 'bstrID' => 'adam.j.bradley@adamjbradley.com' );                	
                $result = $client->GetSLT(array('PassIDIn'=>$PassIDIn,'LoginSeconds'=>60));
            }
            catch (SoapFault $e)
            {
            	echo $e.'    during test conection ';
            }
                
			//echo the last Soap requet and response
			echo "<h1>Request :</h1><br>", htmlspecialchars($client->__getLastRequest()), "<br>";
    		echo "<h1>Response :<br></h1>", htmlspecialchars($client->__getLastResponse()), "<br>";

			unset($client);
    	?>
    </body>
</html>
